home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The PC-SIG Library 9
/
The PC-SIG Library on CD ROM - Ninth Edition.iso
/
101_200
/
DISK0163
/
DISK0163.ZIP
/
FILPS.C
< prev
next >
Wrap
Text File
|
1983-08-22
|
512b
|
29 lines
/* version.c by Michael Hanson */
/* you may use this, but not for profit, and give me credit */
/* file procedure for dos 2.0 */
/* allows redirection of STDIN to work (dosn't hang on EOF) */
static int inchar,filn;
getc(filno)
FILE filno;
{
filn=filno;
#asm
DSEG
INCHAR DW 0000H
CSEG
MOV BX,WORD filn_
MOV CX,01H
MOV DX,OFFSET INCHAR
MOV AH,3FH
INT 21H
JB ERR
CMP AX,0
JE ERR
MOV AX,INCHAR
JMP DONE
ERR: MOV AX,-1H
DONE:
#
}